package com.huawei.appmarket.service.store.awk.card;

import android.content.Context;
import android.graphics.drawable.Drawable;
import android.view.View;
import android.widget.TextView;
import com.huawei.appgallery.foundation.ui.framework.cardkit.bean.CardBean;
import com.huawei.appmarket.service.store.awk.bean.ThreeLineAppSingleGroupCardBean;
import java.util.List;
import kotlin.Metadata;
import kotlin.TypeCastException;
import o.cgz;
import o.chc;
import o.cht$d;
import o.chy;
import o.clk;
import o.dky.c;
import o.dof;
import o.dyf;
import o.epv;
import o.epw;
import o.ewm.e;
import o.ewm.h;
import o.ewm.j;
import o.fqm;
import o.fqr;
import o.frj;
import o.fry;
import o.fsc;
import o.fsd;
import o.fsf;
import o.fsj;
import o.fsx;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;

@Metadata(bv = {1, 0, 3}, d1 = {"\u0000l\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0002\b\u0005\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\b\n\u0000\n\u0002\u0018\u0002\n\u0002\u0010\u000e\n\u0002\b\u0004\n\u0002\u0010\u000b\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0002\b\u0004\u0018\u0000 *2\u00020\u00012\u00020\u0002:\u0001*B\r\u0012\u0006\u0010\u0003\u001a\u00020\u0004¢\u0006\u0002\u0010\u0005J\u0016\u0010\u0010\u001a\u0006\u0012\u0002\b\u00030\u00112\b\u0010\u0012\u001a\u0004\u0018\u00010\u000fH\u0016J\u0010\u0010\u0013\u001a\u00020\u00142\u0006\u0010\u0003\u001a\u00020\u0004H\u0014J\u0010\u0010\u0015\u001a\u00020\u00162\u0006\u0010\u0003\u001a\u00020\u0004H\u0014J\u000e\u0010\u0017\u001a\b\u0012\u0004\u0012\u00020\u00190\u0018H\u0016J\b\u0010\u001a\u001a\u00020\u0016H\u0016J\b\u0010\u001b\u001a\u00020\u0016H\u0014J\b\u0010\u001c\u001a\u00020\u0016H\u0014J\u0010\u0010\u001d\u001a\u00020\u001e2\u0006\u0010\u001f\u001a\u00020 H\u0002J\u0012\u0010!\u001a\u00020\"2\b\u0010#\u001a\u0004\u0018\u00010$H\u0016J\u0012\u0010%\u001a\u00020\"2\b\u0010&\u001a\u0004\u0018\u00010'H\u0016J\u0010\u0010(\u001a\u00020\"2\u0006\u0010)\u001a\u00020\u0016H\u0016R\u001b\u0010\u0006\u001a\u00020\u00078BX\u0002¢\u0006\f\n\u0004\b\n\u0010\u000b\u001a\u0004\b\b\u0010\tR\u0010\u0010\f\u001a\u0004\u0018\u00010\rX\u000e¢\u0006\u0002\n\u0000R\u0010\u0010\u000e\u001a\u0004\u0018\u00010\u000fX\u000e¢\u0006\u0002\n\u0000¨\u0006+"}, d2 = {"Lcom/huawei/appmarket/service/store/awk/card/ThreeLineAppSingleGroupCard;", "Lcom/huawei/appmarket/service/store/awk/card/HorizontalApplistItemCard;", "Lcom/huawei/appgallery/horizontalcard/api/IBaseHorizontalItemCardCustomExposure;", "context", "Landroid/content/Context;", "(Landroid/content/Context;)V", "exposureController", "Lcom/huawei/appmarket/service/exposure/control/ExposureController;", "getExposureController", "()Lcom/huawei/appmarket/service/exposure/control/ExposureController;", "exposureController$delegate", "Lkotlin/Lazy;", "groupTitleTextView", "Landroid/widget/TextView;", "moreLayout", "Landroid/view/View;", "bindCard", "Lcom/huawei/appgallery/foundation/ui/framework/cardframe/card/BaseCard;", "parent", "createSingleItemCard", "Lcom/huawei/appmarket/service/store/awk/card/HorizontalApplistSingleItemCard;", "getAppIconWidth", "", "getCustomExposureDetail", "Ljava/util/ArrayList;", "", "getNumPerLine", "getPadLayout", "getPhoneLayout", "isShowMoreButton", "", "cardBean", "Lcom/huawei/appmarket/service/store/awk/bean/ThreeLineAppSingleGroupCardBean;", "setData", "", "data", "Lcom/huawei/appgallery/foundation/ui/framework/cardkit/bean/CardBean;", "setOnClickListener", "cardEventListener", "Lcom/huawei/appgallery/foundation/ui/framework/cardkit/bean/CardEventListener;", "setPosition", "position", "Companion", "WiseDist_release"}, k = 1, mv = {1, 1, 15})
public final class ThreeLineAppSingleGroupCard extends HorizontalApplistItemCard implements clk {
    static final /* synthetic */ fsx[] ʽ = new fsx[]{fsf.ॱ(new fsj(fsf.ॱ(ThreeLineAppSingleGroupCard.class), "exposureController", "getExposureController()Lcom/huawei/appmarket/service/exposure/control/ExposureController;"))};
    private static final List<Integer> ˏॱ = frj.ˏ(Integer.valueOf(e.ˏ), Integer.valueOf(e.ʼ), Integer.valueOf(e.ʻ));
    public static final d ᐝ = new d();
    private final fqm ˊॱ = fqr.ˋ(b.ˎ);
    private TextView ˋॱ;
    private View ॱˊ;

    @Metadata(bv = {1, 0, 3}, d1 = {"\u0000\b\n\u0000\n\u0002\u0018\u0002\n\u0000\u0010\u0000\u001a\u00020\u0001H\n¢\u0006\u0002\b\u0002"}, d2 = {"<anonymous>", "Lcom/huawei/appmarket/service/exposure/control/ExposureController;", "invoke"}, k = 3, mv = {1, 1, 15})
    static final class b extends fsc implements fry<dyf> {
        public static final b ˎ = new b();

        b() {
            super(0);
        }

        public /* synthetic */ Object ˋ() {
            return ˏ();
        }

        @NotNull
        public final dyf ˏ() {
            return new dyf();
        }
    }

    @Metadata(bv = {1, 0, 3}, d1 = {"\u0000\u0018\n\u0002\u0018\u0002\n\u0002\u0010\u0000\n\u0002\b\u0002\n\u0002\u0010 \n\u0002\u0010\b\n\u0002\b\u0002\b\u0003\u0018\u00002\u00020\u0001B\u0007\b\u0002¢\u0006\u0002\u0010\u0002R\u0014\u0010\u0003\u001a\b\u0012\u0004\u0012\u00020\u00050\u0004X\u0004¢\u0006\u0002\n\u0000R\u000e\u0010\u0006\u001a\u00020\u0005XT¢\u0006\u0002\n\u0000¨\u0006\u0007"}, d2 = {"Lcom/huawei/appmarket/service/store/awk/card/ThreeLineAppSingleGroupCard$Companion;", "", "()V", "backgroundImageResIdList", "", "", "maxItemCount", "WiseDist_release"}, k = 1, mv = {1, 1, 15})
    public static final class d {
        private d() {
        }
    }

    private final dyf ʼ() {
        fqm o_fqm = this.ˊॱ;
        fsx o_fsx = ʽ[0];
        return (dyf) o_fqm.ˎ();
    }

    @org.jetbrains.annotations.NotNull
    public java.util.ArrayList<java.lang.String> ॱ() {
        /* JADX: method processing error */
/*
Error: jadx.core.utils.exceptions.DecodeException: Load method exception in method: com.huawei.appmarket.service.store.awk.card.ThreeLineAppSingleGroupCard.ॱ():java.util.ArrayList<java.lang.String>
	at jadx.core.dex.nodes.MethodNode.load(MethodNode.java:116)
	at jadx.core.dex.nodes.ClassNode.load(ClassNode.java:249)
	at jadx.core.ProcessClass.process(ProcessClass.java:34)
	at jadx.api.JadxDecompiler.processClass(JadxDecompiler.java:306)
	at jadx.api.JavaClass.decompile(JavaClass.java:62)
Caused by: java.lang.NullPointerException
*/
        /*
        r0 = this;
        r3 = 0;
        r5 = 1;
        r4 = 0;
        r0 = 3;
        r0 = new com.huawei.appmarket.service.store.awk.card.HorizontalApplistSingleItemCard[r0];
        r1 = r8.ॱॱ;
        r0[r4] = r1;
        r1 = r8.ʼ;
        r0[r5] = r1;
        r1 = 2;
        r2 = r8.ʻ;
        r0[r1] = r2;
        r0 = o.frj.ˏ(r0);
        r0 = (java.lang.Iterable) r0;
        r1 = new java.util.ArrayList;
        r1.<init>();
        r1 = (java.util.Collection) r1;
        r6 = r0.iterator();
    L_0x0024:
        r0 = r6.hasNext();
        if (r0 == 0) goto L_0x0058;
    L_0x002a:
        r2 = r6.next();
        r0 = r2;
        r0 = (com.huawei.appmarket.service.store.awk.card.HorizontalApplistSingleItemCard) r0;
        r7 = "it";
        o.fsd.ॱ(r0, r7);
        r0 = r0.ˉ();
        if (r0 != 0) goto L_0x0044;
    L_0x003c:
        r0 = r4;
        if (r0 == 0) goto L_0x0024;
    L_0x0040:
        r1.add(r2);
        goto L_0x0024;
    L_0x0044:
        r7 = r0.getVisibility();
        if (r7 != 0) goto L_0x0056;
    L_0x004a:
        r7 = r8.ʼ();
        r0 = r7.ˎ(r0);
        if (r0 == 0) goto L_0x0056;
    L_0x0054:
        r0 = r5;
        goto L_0x003d;
    L_0x0056:
        r0 = r4;
        goto L_0x003d;
    L_0x0058:
        r1 = (java.util.List) r1;
        r1 = (java.lang.Iterable) r1;
        r0 = new java.util.ArrayList;
        r0.<init>();
        r0 = (java.util.Collection) r0;
        r2 = r1.iterator();
        r1 = r2.hasNext();
        if (r1 == 0) goto L_0x00ae;
        r1 = r2.next();
        r1 = (com.huawei.appmarket.service.store.awk.card.HorizontalApplistSingleItemCard) r1;
        r4 = "it";
        o.fsd.ॱ(r1, r4);
        r1 = r1.ˌ();
        r4 = r1 instanceof com.huawei.appmarket.service.store.awk.bean.HorizonalHomeCardItemBean;
        if (r4 != 0) goto L_0x0081;
        r1 = r3;
        r1 = (com.huawei.appmarket.service.store.awk.bean.HorizonalHomeCardItemBean) r1;
        if (r1 != 0) goto L_0x008e;
        r1 = r3;
        if (r1 == 0) goto L_0x008c;
        r0.add(r1);
        goto L_0x0067;
        r4 = new java.lang.StringBuilder;
        r4.<init>();
        r5 = r1.ॱॱ();
        r4 = r4.append(r5);
        r5 = "#$#";
        r4 = r4.append(r5);
        r1 = r1.u_();
        r1 = r4.append(r1);
        r1 = r1.toString();
        goto L_0x0086;
        r0 = (java.util.List) r0;
        r1 = new java.util.ArrayList;
        r1.<init>();
        r0 = (java.util.Collection) r0;
        r1.addAll(r0);
        return r1;
        */
        throw new UnsupportedOperationException("Method not decompiled: com.huawei.appmarket.service.store.awk.card.ThreeLineAppSingleGroupCard.ॱ():java.util.ArrayList<java.lang.String>");
    }

    public ThreeLineAppSingleGroupCard(@NotNull Context context) {
        fsd.ˊ((Object) context, "context");
        super(context);
    }

    public int ॱॱ() {
        return epv.ˏॱ(this.ʼॱ) ? 2 : chc.ॱˎ();
    }

    public int ˊ() {
        return h.ᐝꜟ;
    }

    public int ˎ() {
        return h.ᐝꜟ;
    }

    @NotNull
    protected HorizontalApplistSingleItemCard ॱ(@NotNull Context context) {
        fsd.ˊ((Object) context, "context");
        return new ThreeLineAppSingleItemCard(context);
    }

    protected int ˎ(@NotNull Context context) {
        fsd.ˊ((Object) context, "context");
        return context.getResources().getDimensionPixelSize(c.ˎ);
    }

    @NotNull
    public cgz<?> ˏ(@Nullable View view) {
        TextView textView;
        View view2 = null;
        super.ˏ(view);
        if (view != null) {
            textView = (TextView) view.findViewById(j.ʻꓸ);
        } else {
            textView = null;
        }
        this.ˋॱ = textView;
        if (view != null) {
            view2 = view.findViewById(j.ʻꜟ);
        }
        this.ॱˊ = view2;
        return this;
    }

    public void ᐝ(int i) {
        super.ᐝ(i);
        Drawable drawable = this.ʼॱ.getDrawable(((Number) ˏॱ.get(i % ˏॱ.size())).intValue());
        if (drawable != null) {
            drawable.setAlpha(epw.ˏ() ? 51 : 255);
        }
        View view = this.ˊˋ;
        if (view != null) {
            view.setBackground(drawable);
        }
    }

    public void ˏ(@Nullable CardBean cardBean) {
        CardBean cardBean2;
        if (cardBean instanceof ThreeLineAppSingleGroupCardBean) {
            cardBean2 = cardBean;
        } else {
            cardBean2 = null;
        }
        ThreeLineAppSingleGroupCardBean threeLineAppSingleGroupCardBean = (ThreeLineAppSingleGroupCardBean) cardBean2;
        if (threeLineAppSingleGroupCardBean != null) {
            this.ˊᐝ = threeLineAppSingleGroupCardBean;
            TextView textView = this.ˋॱ;
            if (textView != null) {
                textView.setText(threeLineAppSingleGroupCardBean.v_());
            }
            TextView textView2 = this.ˋॱ;
            if (textView2 != null) {
                textView2.requestLayout();
            }
            View view = this.ॱˊ;
            if (view != null) {
                view.setVisibility(ˎ(threeLineAppSingleGroupCardBean) ? 0 : 4);
            }
            List ʻˋ = threeLineAppSingleGroupCardBean.ʻˋ();
            if (ʻˋ == null) {
                ʻˋ = frj.ˎ();
            }
            if (ʻˋ == null) {
                throw new TypeCastException("null cannot be cast to non-null type kotlin.collections.List<com.huawei.appgallery.foundation.ui.framework.cardkit.bean.CardBean>");
            }
            ˋ(ʻˋ);
        }
    }

    public void ॱ(@Nullable chy o_chy) {
        super.ॱ(o_chy);
        cht$d o_cht_d = new cht$d(o_chy, this);
        View view = this.ॱˊ;
        if (view != null) {
            view.setOnClickListener(o_cht_d);
        }
    }

    private final boolean ˎ(ThreeLineAppSingleGroupCardBean threeLineAppSingleGroupCardBean) {
        if (dof.ʽ(threeLineAppSingleGroupCardBean.ॱॱ())) {
            return false;
        }
        List ʻˋ = threeLineAppSingleGroupCardBean.ʻˋ();
        if ((ʻˋ != null ? ʻˋ.size() : 0) > 3 || threeLineAppSingleGroupCardBean.ʾॱ() != 0) {
            return true;
        }
        return false;
    }
}
